home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Technotools
/
Technotools (Chestnut CD-ROM)(1993).ISO
/
lantools
/
bkup
/
r_proces.bat
< prev
next >
Wrap
DOS Batch File
|
1990-08-24
|
5KB
|
129 lines
:... B_PROCES.BAT, Craig MacPherson
: This batch file processes backup requestes from users. It is called
: from the users backup job batch file. This file is processed on the
: backup server.
:
: Variables passed
: %1 = Userid
: %2 = Requested Tape
: %3 = Save Set
: %4 = Drive (C:)
: %5 = Opt Dir (\)
: %6 = Sub Dir Toggle (/S)
: %7 = Overwrite Toggle (/Q)
:... Set variables for tape change, read by Basic programs below
set REQ_TAPE=%2
set RE_LOAD=%TAPE%
:... Del the que file to indicate processing has started
del %D2%\backups\restore.jbs\%1.que
:... Load Map Assist and connect to users workstation, remote drive o:
MA o:=Trilan1/%1
if errorlevel 1 goto NO_CONNECT
:... Clean out skipped and corrupt file logs
call %D1%b_skip.bat DELETE
:LOAD_TAPE
:... Get Operator to load the tape
send "Tape mount requested by %1, tape - #%2" %NOTIFY%
be beep %SOUND%
cls
echo.
echo A tape mount has been requested, enter option:
echo.
echo C - Tape #%2 is onsite, ( C )ontinue with tape mount request
echo K - Tape #%2 is offsite, ( K )ill job and message user
echo.
echo Delay for 100 seconds, Enter Selection:
be ask "", ack DEFAULT=a TIMEOUT=100
if errorlevel 3 goto OFF_SITE
if errorlevel 2 goto START_RESTORE
goto LOAD_TAPE
:START_RESTORE
:... Load backup tape
basica %d1%req_tape.bas
call req_tape.bat
del req_tape.bat
:... Update the backup system activity.log file with tape info
echo ***************** Tape Change: New Tape =%TAPE% OP=%OP% **************************>tmp.inp
copy %D2%\backups\activity.lgs\activity.log + tmp.inp %D2%\backups\activity.lgs\activity.log>>nul:
del tmp.inp
:... Update the users detailed history log with restore info...
echo restore to %1 %4%5 with toggles %6%7 from tape #%2 set %3>>%D2%\backups\activity.lgs\%1.his
:... Start the restore process
set STATUS=GOOD
echo restoring to %1 %4%5 with toggles %6%7 from tape #%2 set %3
trestore o:%5/li:"files.tmp"/Y/V:%3%6%7
if errorlevel set STATUS=BAD
:UPDATE_LOGS
:... Add Maynard tape program output to users detailed history log
if not exist %D2%\backups\restore.jbs\files.tmp set STATUS=BAD
if not exist %D2%\backups\restore.jbs\files.tmp echo " Restore Failed">>%D2%\backups\activity.lgs\%1.his
copy %D2%\backups\activity.lgs\%1.his+%D2%\backups\restore.jbs\files.tmp %D2%\backups\activity.lgs\%1.his
if exist %D2%\backups\restore.jbs\files.tmp del %D2%\backups\restore.jbs\files.tmp>>nul:
:... Check for skipped or corrupt files, add info to users detailed history log
call %D1%b_skip.bat %1
goto MARK_EOJ
:NO_CONNECT
:... Mark users history log with no connect message
copy %D2%\backups\activity.lgs\%1.his+%D2%\backups\no_con.asc %D2%\backups\activity.lgs\%1.his
set STATUS=NO_CON
:MARK_EOJ
:... Mark EOJ in users history file
call %D1%b_eoj.bat %1
:... Strip Form Feeds from users history file
call %D1%b_strip.bat %1
:SYSTEM AND USER SUMMARY LOGS
:... Add user info and status to system activity log and user summary log
call %D1%b_activ.bat RESTORE %STATUS% %1 %2 %3 %4 %5 %6 %7
:... Unload Mapassist
MA -
:... Send user a message
send "Restore of %4%5 Completed" %1
:RELOAD
:... Reload todays backup tape and place entry in activity log.
send "Tape mount requested, by Backup Server" %NOTIFY%
be beep %SOUND%
echo.
echo Prepare to mount todays backup tape
echo.
echo.
be ask "Hit X when ready to mount tape", cx DEFAULT=c TIMEOUT=50
if errorlevel 2 goto UPDATE_LOGS
goto RELOAD
:... Re-load backup tape, sets env variables for OP and TAPE
basica %D1%re_load.bas
call re_load.bat
del re_load.bat
:... Update the backup system activity.log file with tape info
echo ***************** Tape Change: New Tape =%TAPE% OP=%OP% **************************>tmp.inp
copy %D2%\backups\activity.lgs\activity.log + tmp.inp %D2%\backups\activity.lgs\activity.log>>nul:
del tmp.inp
goto END
:OFF_SITE
Send "Tape #%2 is Offsite, Contact Client Services" %1
:END